<template>
  <div>
    <mt-swipe :auto="40000">
      <mt-swipe-item v-for="item in imgList" :key="item.id">
        <img :src="item.url" class="swipe-img" />
      </mt-swipe-item>
    </mt-swipe>

    <div class="mui-content">
      <ul class="mui-table-view mui-grid-view mui-grid-9">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <router-link to="/home/newsList">
            <img src="../../assets/images/menu1.png" alt />
            <div class="mui-media-body">新闻资讯</div>
          </router-link>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <router-link to="/home/photoList">
            <img src="../../assets/images/menu2.png" alt />
            <div class="mui-media-body">图片分享</div>
          </router-link>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <router-link to="/home/goodsList">
            <img src="../../assets/images/menu3.png" alt />
            <div class="mui-media-body">商品购买</div>
          </router-link>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../../assets/images/menu4.png" alt />
            <div class="mui-media-body">留言反馈</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../../assets/images/menu5.png" alt />
            <div class="mui-media-body">视频专区</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
          <a href="#">
            <img src="../../assets/images/menu6.png" alt />
            <div class="mui-media-body">联系我们</div>
          </a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      imgList: [
        {
          id: 1,
          url: "https://t11.baidu.com/it/u=3111680821,1923575273&fm=76"
        },
        { id: 2, url: "https://f11.baidu.com/it/u=562310602,3964966323&fm=76" },
        { id: 3, url: "https://t12.baidu.com/it/u=949809209,3396256312&fm=76" }
      ]
    };
  },
  methods: {
    createImgList() {
      this.$http.get("api/getlunbo").then(r => {
        if (r.body.status == 0) {
          Toast({
            message: "加载完成",
            position: "bottom",
            duration: 1000
          });
        } else {
          Toast({
            message: "网络错误",
            position: "bottom",
            duration: 1000
          });
        }
      });
    }
  },
  created() {
    this.createImgList();
  }
};
</script>

<style scoped>
.mint-swipe {
  height: 200px;
}
.swipe-img {
  height: 100%;
  width: 100%;
}

.mui-grid-view.mui-grid-9 {
  background-color: #fff;
  border: 0;
}

.mui-grid-view.mui-grid-9 .mui-table-view-cell {
  background-color: #fff;
  border: 0;
}

img {
  width: 60px;
  height: 60px;
}
</style>>

